home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / programer2 / icon / Docs / Ipd138 < prev    next >
Text File  |  1990-07-19  |  12KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.              Compiling Version 8 of Icon for MS-DOS
  8.  
  9.                         Ralph E. Griswold
  10.     Department of Computer Science, The University of Arizona
  11.  
  12.  
  13. 1.__Background
  14.  
  15.    The implementation of the Icon programming language is large
  16. and complex [1]. It is, however, written almost entirely in C,
  17. and it is designed to be portable to a wide range of computers
  18. and operating systems.  This document concerns the compilation of
  19. Version 8 of Icon for MS-DOS.
  20.  
  21.    Version 8 of Icon runs on computers with 8086/88/186/286/386-
  22. family processors. IBM hardware compatibility is not required.
  23. Either MS-DOS or PC-DOS, Version 2.0 or higher, is needed.
  24. Specific C compilers may impose more stringent requirements.
  25. Version 8 of Icon is a large-memory-model program that requires
  26. at least 512KB of RAM to perform satisfactorily.
  27.  
  28.    As of the date of this document, Version 8 of Icon for MS-DOS
  29. has been successfully compiled a large-memory model program with
  30. the following C compilers:
  31.  
  32.         Microsoft C 5.10 (MS-DOS and OS/2)
  33.         Turbo C 2.0
  34.         Lattice C 6.01
  35.         Mark Williams Let's C 4.0.12
  36.  
  37. Icon may compile under some earlier versions of these compilers,
  38. but details are not known.
  39.  
  40.    Icon built under Microsoft C 5.10 supports all features of
  41. Icon and has no known bugs.  Icon compiler under Turbo C 2.0 sup-
  42. port all features of Icon, but co-expressions do not work prop-
  43. erly.  Icon compiled under Lattice C 6.01 supports all features
  44. of Icon except large-integer arithmetic (the module is too large
  45. to compile), and co-expressions are not implemented.  Icon com-
  46. piled under Mark Williams Let's C 4.0.12 runs some programs, but
  47. there are numerous problems. More detailed information is pro-
  48. vided in status files that accompany the distribution.
  49.  
  50.    The use of another C compiler will certainly involve some
  51. work, since there is some code that is conditional on the charac-
  52. teristics of specific C compilers. Compiling Icon is beyond the
  53. capability of many C compilers - be forewarned. For some C com-
  54. pilers, it also may be necessary to make some compromises in the
  55. facilities that Icon supports.  If you plan to try compiling Icon
  56. on a compiler other than one of those listed above, request
  57. technical report TR 88-9 from the Icon Project.
  58.  
  59.    The Microsoft macro assembler (MASM) is needed for the
  60. optional assembly-language component of Icon - co-expressions.
  61.  
  62.  
  63.  
  64. IPD138                        - 1 -                 April 5, 1990
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. This feature can be omitted if you do not have MASM.
  74.  
  75.  
  76. 2.__Organization_of_the_Implementation
  77.  
  78.    The source code for Icon is organized in a hierarchy.  To
  79. facilitate file transfer, files for various directories are pack-
  80. aged in arc format.  Instructions for unloading the files are
  81. provided on the distribution diskettes.
  82.  
  83.    If the Icon hierarchy is rooted in \icon, the directories fol-
  84. lowing unloading are:
  85.  
  86.                                      |-common--------
  87.                                      |-icont---------
  88.                      |-src-----------|-iconx---------
  89.      |-icon----------|               |-h-------------
  90.                      |
  91.                      |               |-lattice-------
  92.                      |               |-microsf5------
  93.                      |-scripts-------|-mwc-----------
  94.                      |               |-os2-----------
  95.                      |               |-turbo---------
  96.                      |
  97.                      |-tests---------|-local---------
  98.                                      |-stand---------
  99.  
  100.  
  101.    The distribution diskettes also contain documentation and some
  102. tools that may be useful in building and testing Icon. See README
  103. on the distribution diskettes.
  104.  
  105. 2.1__Source_Files
  106.  
  107.    The four source-code sub-directories under src contain the
  108. following components of Icon:
  109.  
  110.      common    files common to different components of Icon.
  111.  
  112.      h         header files used by files in the other direc-
  113.                tories.
  114.  
  115.      icont     source code for the translator and linker that
  116.                converts a source-language program into an icode
  117.                that is executed by iconx.
  118.  
  119.      iconx     source code for the executor for icode, including
  120.                a run-time system that supports the operations of
  121.                the Icon language.
  122.  
  123. 2.2__Configuration_Directories
  124.  
  125.    In order to simplify the process of compiling Icon under dif-
  126. ferent C compilers, files that are compiler-specific, including
  127.  
  128.  
  129.  
  130. IPD138                        - 2 -                 April 5, 1990
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139. batch and linker files, are provided in subdirectories of the
  140. scripts directory. There are presently five of these configura-
  141. tion directories:
  142.  
  143.         lattice   Lattice C 6.01
  144.         microsf5  Microsoft C 5.10 for MS-DOS
  145.         mwc       Let's C 4.0.12
  146.         os2       Microsoft C 5.10 for OS/2
  147.         turbo     Turbo C 2.0
  148.  
  149. The use of these configuration directories is described in Sec-
  150. tion 3.
  151.  
  152.  
  153. 3.__An_Overview_of_the_Compilation_Process
  154.  
  155.    Before starting to compile Icon, be sure your C compiler is
  156. properly installed and that any paths that it needs are properly
  157. set.
  158.  
  159. Configuration
  160.  
  161.    The first step in the compilation process is to configure the
  162. source code.  If you are using one of the C compilers described
  163. above, there is a .bat file in the top level of the icon hierar-
  164. chy (e.g. \icon) whose name corresponds to the configuration
  165. directory. Executing the .bat file performs the configuration.
  166. For example, if you want to configure Version 8 of Icon to com-
  167. pile under Microsoft C 5.10, just type
  168.  
  169.         microsf5
  170.  
  171. These batch files first erase files that may be left over from a
  172. previous configuration ("File not found" is normal at this
  173. point), and then they copy in compiler-specific scripts and
  174. source files.
  175.  
  176. Assembly-Language_Matters
  177.  
  178.    The assembly-language component of Icon requires macro files
  179. that are provided with the C compiler (not as part of the Icon
  180. source).  For the Microsoft C compiler, the files cmacros.inc and
  181. version.inc are needed.  These files are included in the Micro-
  182. soft C distributions, but to the best of our knowledge, their
  183. location or purpose is not documented. You may have to search for
  184. them on the Microsoft distribution diskettes.  cmacros.inc should
  185. be installed in \mac.  version.inc should be installed at \mac\l
  186. (ell).
  187.  
  188.    If you do not have MASM or do not want to include the
  189. assembly-language component of Icon for some other reason, add
  190. the following line to src\h\define.h:
  191.  
  192.  
  193.  
  194.  
  195.  
  196. IPD138                        - 3 -                 April 5, 1990
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.         #define NoCoexpr         /* disable co-expressions */
  206.  
  207. See also the remark at the end of the following section about
  208. compilation without the assembly-language component of Icon.
  209.  
  210. Extra_Functions_for_MS-DOS
  211.  
  212.    There are a few functions specially designed for using Icon
  213. under MS-DOS that are not part of Icon's standard function reper-
  214. toire.  The functions are described in [2] (ipd132.doc on the
  215. distribution diskettes).  These functions normally are included
  216. in the compilation process. If you wish to eliminate them (which
  217. decreases the size of iconx by a few thousand bytes), remove
  218.  
  219.         #define DosFncs
  220.  
  221. from src\h\define.h.
  222.  
  223. Large-Integer_Arithmetic
  224.  
  225.    Icon has facilities for large-integer arithmetic, but these
  226. facilities are disabled by default in MS-DOS Icon because they
  227. increase the size of iconx substantially (20-30KB). If you have
  228. enough RAM and wish to enable large-integer arithmetic, remove
  229. the following line from src\h\define.h:
  230.  
  231.         #define NoLargeInts
  232.  
  233.  
  234. Compilation
  235.  
  236.    First go to the directory src\common and compile the source
  237. files there.
  238.  
  239.    Then go to src\icont and src\iconx and compile and link the
  240. source files there to produce the executable files icont.exe and
  241. iconx.exe, respectively.
  242.  
  243.    Finally, copy the executable files to their desired location.
  244.  
  245.    A public-domain version of a UNIX-style make utility is pro-
  246. vided on the distribution diskettes. Makefiles for each subdirec-
  247. tory are copied into place during configuration. This make util-
  248. ity is different from (and more powerful) than the make utilities
  249. provided by present MS-DOS C compilers. If you do not want to use
  250. it, there is a build.bat file in each source subdirectory that
  251. compiles and links all files without using make.
  252.  
  253.    If you disabled the assembly-language component of Icon, you
  254. will need to change the makefile or build.bat file in src\iconx
  255. to remove the assembly steps.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. IPD138                        - 4 -                 April 5, 1990
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. 3.1__Testing
  272.  
  273.    A suite of test programs is provided with the distribution.
  274. The tests range from a variety of simple programs to batteries of
  275. expressions.  The test programs themselves are in the directory
  276. tests. The expected output of the test programs is in
  277. tests\stand; tests\local is provided for local output.
  278.  
  279.    The directory tests contains several files of the form
  280. name.lst, which consist of the names of test programs. Testing
  281. can be done with these files and the program runtests provided
  282. with the distribution.  The form is:
  283.  
  284.         runtests name.lst > name.res
  285.  
  286. where name is one of the files mentioned above. As a result,
  287. name.res contains a list showing differences.
  288.  
  289.    Note: Local output may differ in some cases from the output in
  290. stand.  This may be due to compiler or system differences. Also,
  291. in a few cases, recent changes to Icon may produce output some-
  292. what different from that in stand. See README on the distribution
  293. diskettes for the latest information.
  294.  
  295.  
  296. 4.__The_Implementation_Book
  297.  
  298.    If you are interested in the larger view of the implementation
  299. of Icon, or if you are interested in modifying or extending Icon,
  300. you may want to acquire the book The Implementation of the Icon
  301. Programming Language.  This book concentrates on the run-time
  302. system and covers data structures, the virtual machine, the
  303. interpreter, the implementation of generators, and storage
  304. management. It also contains material specifically related to
  305. making modifications to the source code.
  306.  
  307.    The publication information is: The Implementation of the Icon
  308. Programming Language, by Griswold and Griswold, Princeton Univer-
  309. sity Press, ISBN 0-691-08431-9, hardbound, 336 pages, $44.50. The
  310. book may be ordered from the Icon Project, a local bookstore, or
  311. directly from the publisher:
  312.  
  313.         Princeton University Press
  314.         3175 Princeton Pike
  315.         Lawrenceville, NJ   08648
  316.  
  317.         (609) 896-1344
  318.  
  319.  
  320.    The implementation book corresponds to Version 6.2 of the Icon
  321. source code.  There have been several changes in the source code
  322. between Version 6.2 and the present version. A supplement
  323. describing these changes is available free of charge from the
  324. Icon Project [3].  Ask for IPD112.
  325.  
  326.  
  327.  
  328. IPD138                        - 5 -                 April 5, 1990
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. 5.__Trouble_Reports_and_Feedback
  338.  
  339.    If you run into problems, contact the Icon Project:
  340.  
  341.         Icon Project
  342.         Department of Computer Science
  343.         Gould-Simpson Building
  344.         The University of Arizona
  345.         Tucson, AZ   85721
  346.         U.S.A.
  347.         (602) 621-4049
  348.         icon-project@cs.arizona.edu     (Internet)
  349.         ... {uunet, allegra, noao}!arizona!icon-project     (uucp)
  350.  
  351.  
  352.    We cannot promise to solve your problems, but we will try. We
  353. also may be able to place you in contact with other persons who
  354. are compiling Icon and who may have similar problems.
  355.  
  356.    Please also let us know of any suggestions for improvements to
  357. the compilation process or its documentation.
  358.  
  359. Acknowledgements
  360.  
  361.    Many persons have been involved in the implementation of Icon.
  362. Cheyenne Wills did most of the work to adapt Icon for use under
  363. MS-DOS.  He also provided most of the tools that are included in
  364. the distribution.
  365.  
  366. References
  367.  
  368.  
  369. 1.   R. E. Griswold and M. T. Griswold, The Implementation of the
  370.      Icon Programming Language, Princeton University Press, 1986.
  371.  
  372. 2.   R. E. Griswold, Version 8 of Icon for MS-DOS, The Univ. of
  373.      Arizona Icon Project Document IPD132, 1990.
  374.  
  375. 3.   R. E. Griswold, Supplementary Information for the
  376.      Implementation of Version 8 of Icon, The Univ. of Arizona
  377.      Icon Project Document IPD112, 1990.
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. IPD138                        - 6 -                 April 5, 1990
  395.  
  396.  
  397.